<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QWorkspace Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QWorkspace Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QWorkspace widget provides a workspace window that can be
used in an MDI application. <a href="#details">More...</a></p>

<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qworkspace.html#WindowOrder-enum">WindowOrder</a></b> { CreationOrder, StackingOrder }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qworkspace.html#QWorkspace">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qworkspace.html#activateNextWindow">activateNextWindow</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#activatePreviousWindow">activatePreviousWindow</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qworkspace.html#activeWindow">activeWindow</a></b> (<i>self</i>)</li><li><div class="fn" />QWidget <b><a href="qworkspace.html#addWindow">addWindow</a></b> (<i>self</i>, QWidget&#160;<i>w</i>, Qt.WindowFlags&#160;<i>flags</i>&#160;=&#160;0)</li><li><div class="fn" /><b><a href="qworkspace.html#arrangeIcons">arrangeIcons</a></b> (<i>self</i>)</li><li><div class="fn" />QBrush <b><a href="qworkspace.html#background">background</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#cascade">cascade</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent)</li><li><div class="fn" /><b><a href="qworkspace.html#childEvent">childEvent</a></b> (<i>self</i>, QChildEvent)</li><li><div class="fn" /><b><a href="qworkspace.html#closeActiveWindow">closeActiveWindow</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#closeAllWindows">closeAllWindows</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qworkspace.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" />bool <b><a href="qworkspace.html#eventFilter">eventFilter</a></b> (<i>self</i>, QObject, QEvent)</li><li><div class="fn" /><b><a href="qworkspace.html#hideEvent">hideEvent</a></b> (<i>self</i>, QHideEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#paintEvent">paintEvent</a></b> (<i>self</i>, QPaintEvent&#160;<i>e</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QResizeEvent)</li><li><div class="fn" />bool <b><a href="qworkspace.html#scrollBarsEnabled">scrollBarsEnabled</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#setActiveWindow">setActiveWindow</a></b> (<i>self</i>, QWidget&#160;<i>w</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#setBackground">setBackground</a></b> (<i>self</i>, QBrush&#160;<i>background</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#setScrollBarsEnabled">setScrollBarsEnabled</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent&#160;<i>e</i>)</li><li><div class="fn" />QSize <b><a href="qworkspace.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#tile">tile</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qworkspace.html#wheelEvent">wheelEvent</a></b> (<i>self</i>, QWheelEvent&#160;<i>e</i>)</li><li><div class="fn" />list-of-QWidget <b><a href="qworkspace.html#windowList">windowList</a></b> (<i>self</i>, WindowOrder&#160;<i>order</i>&#160;=&#160;QWorkspace.CreationOrder)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qworkspace.html#windowActivated">windowActivated</a></b> (QWidget *)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QWorkspace widget provides a workspace window that can be
used in an MDI application.</p>
<p>This class is deprecated. Use <a href="qmdiarea.html">QMdiArea</a> instead.</p>
<p>Multiple Document Interface (MDI) applications are typically
composed of a main window containing a menu bar, a toolbar, and a
central QWorkspace widget. The workspace itself is used to display
a number of child windows, each of which is a widget.</p>
<p>The workspace itself is an ordinary Qt widget. It has a standard
constructor that takes a parent widget. Workspaces can be placed in
any layout, but are typically given as the central widget in a
<a href="qmainwindow.html">QMainWindow</a>:</p>
<pre class="cpp">
 MainWindow<span class="operator">.</span>MainWindow()
 {
     workspace <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QWorkspace</span>;
     setCentralWidget(workspace);
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }
</pre>
<p>Child windows (MDI windows) are standard Qt widgets that are
inserted into the workspace with <a href="qworkspace.html#addWindow">addWindow</a>(). As with top-level
widgets, you can call functions such as <a href="qwidget.html#show">show</a>(), <a href="qwidget.html#hide">hide</a>(), <a href="qwidget.html#showMaximized">showMaximized</a>(), and <a href="qwidget.html#windowTitle-prop">setWindowTitle</a>() on a child
window to change its appearance within the workspace. You can also
provide widget flags to determine the layout of the decoration or
the behavior of the widget itself.</p>
<p>To change or retrieve the geometry of a child window, you must
operate on its <a href="qwidget.html#parentWidget">parentWidget</a>(). The <a href="qwidget.html#parentWidget">parentWidget</a>() provides access to
the decorated frame that contains the child window widget. When a
child window is maximised, its decorated frame is hidden. If the
top-level widget contains a menu bar, it will display the maximised
window's operations menu to the left of the menu entries, and the
window's controls to the right.</p>
<p>A child window becomes active when it gets the keyboard focus,
or when <a href="qwidget.html#setFocus">setFocus</a>() is called.
The user can activate a window by moving focus in the usual ways,
for example by clicking a window or by pressing Tab. The workspace
emits a signal <a href="qworkspace.html#windowActivated">windowActivated</a>() when the
active window changes, and the function <a href="qworkspace.html#activeWindow">activeWindow</a>() returns a pointer
to the active child window, or 0 if no window is active.</p>
<p>The convenience function <a href="qworkspace.html#windowList">windowList</a>() returns a list of all
child windows. This information could be used in a popup menu
containing a list of windows, for example. This feature is also
available as part of the <a href="http://qt.nokia.com/products/add-on-products/catalog/4/Widgets/qtwindowlistmenu/">
Window Menu</a> Solution.</p>
<p>QWorkspace provides two built-in layout strategies for child
windows: <a href="qworkspace.html#cascade">cascade</a>() and
<a href="qworkspace.html#tile">tile</a>(). Both are slots so you
can easily connect menu entries to them.</p>
<table class="generic">
<tr class="odd" valign="top">
<td><img alt="" src="images/mdi-cascade.png" /></td>
<td><img alt="" src="images/mdi-tile.png" /></td>
</tr>
</table>
<p>If you want your users to be able to work with child windows
larger than the visible workspace area, set the <a href="qworkspace.html#scrollBarsEnabled-prop">scrollBarsEnabled</a>
property to true.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="WindowOrder-enum" />QWorkspace.WindowOrder</h3><p>Specifies the order in which child windows are returned from
<a href="qworkspace.html#windowList">windowList</a>().</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QWorkspace.CreationOrder</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The windows are returned in the order of their
creation</td>
</tr>
<tr>
<td class="topAlign"><tt>QWorkspace.StackingOrder</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The windows are returned in the order of their
stacking</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QWorkspace" />QWorkspace.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a workspace with the given <i>parent</i>.</p>


<h3 class="fn"><a name="activateNextWindow" />QWorkspace.activateNextWindow (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void activateNextWindow()</tt>.</p><p>Gives the input focus to the next window in the list of child
windows.</p>
<p><b>See also</b> <a href="qworkspace.html#activatePreviousWindow">activatePreviousWindow</a>().</p>


<h3 class="fn"><a name="activatePreviousWindow" />QWorkspace.activatePreviousWindow (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void activatePreviousWindow()</tt>.</p><p>Gives the input focus to the previous window in the list of
child windows.</p>
<p><b>See also</b> <a href="qworkspace.html#activateNextWindow">activateNextWindow</a>().</p>


<h3 class="fn"><a name="activeWindow" /><a href="qwidget.html">QWidget</a> QWorkspace.activeWindow (<i>self</i>)</h3><p>Returns a pointer to the widget corresponding to the active
child window, or 0 if no window is active.</p>
<p><b>See also</b> <a href="qworkspace.html#setActiveWindow">setActiveWindow</a>().</p>


<h3 class="fn"><a name="addWindow" /><a href="qwidget.html">QWidget</a> QWorkspace.addWindow (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>w</i>, <a href="qt-windowflags.html">Qt.WindowFlags</a>&#160;<i>flags</i>&#160;=&#160;0)</h3><p>The <i>w</i> argument has it's ownership transferred to Qt.</p><p>Adds widget <i>w</i> as new sub window to the workspace. If
<i>flags</i> are non-zero, they will override the flags set on the
widget.</p>
<p>Returns the widget used for the window frame.</p>
<p>To remove the widget <i>w</i> from the workspace, simply call
<a href="qwidget.html#setParent">setParent</a>() with the new
parent (or 0 to make it a stand-alone window).</p>


<h3 class="fn"><a name="arrangeIcons" />QWorkspace.arrangeIcons (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void arrangeIcons()</tt>.</p><p>Arranges all iconified windows at the bottom of the
workspace.</p>
<p><b>See also</b> <a href="qworkspace.html#cascade">cascade</a>()
and <a href="qworkspace.html#tile">tile</a>().</p>


<h3 class="fn"><a name="background" /><a href="qbrush.html">QBrush</a> QWorkspace.background (<i>self</i>)</h3><h3 class="fn"><a name="cascade" />QWorkspace.cascade (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void cascade()</tt>.</p><p>Arranges all the child windows in a cascade pattern.</p>
<p><b>See also</b> <a href="qworkspace.html#tile">tile</a>() and
<a href="qworkspace.html#arrangeIcons">arrangeIcons</a>().</p>


<h3 class="fn"><a name="changeEvent" />QWorkspace.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>


<h3 class="fn"><a name="childEvent" />QWorkspace.childEvent (<i>self</i>, <a href="qchildevent.html">QChildEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#childEvent">QObject.childEvent</a>().</p>


<h3 class="fn"><a name="closeActiveWindow" />QWorkspace.closeActiveWindow (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void closeActiveWindow()</tt>.</p><p>Closes the child window that is currently active.</p>
<p><b>See also</b> <a href="qworkspace.html#closeAllWindows">closeAllWindows</a>().</p>


<h3 class="fn"><a name="closeAllWindows" />QWorkspace.closeAllWindows (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void closeAllWindows()</tt>.</p><p>Closes all child windows.</p>
<p>If any child window fails to accept the close event, the
remaining windows will remain open.</p>
<p><b>See also</b> <a href="qworkspace.html#closeActiveWindow">closeActiveWindow</a>().</p>


<h3 class="fn"><a name="event" />bool QWorkspace.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="eventFilter" />bool QWorkspace.eventFilter (<i>self</i>, <a href="qobject.html">QObject</a>, <a href="qevent.html">QEvent</a>)</h3><p>Reimplemented from <a href="qobject.html#eventFilter">QObject.eventFilter</a>().</p>


<h3 class="fn"><a name="hideEvent" />QWorkspace.hideEvent (<i>self</i>, <a href="qhideevent.html">QHideEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#hideEvent">QWidget.hideEvent</a>().</p>


<h3 class="fn"><a name="paintEvent" />QWorkspace.paintEvent (<i>self</i>, <a href="qpaintevent.html">QPaintEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget.paintEvent</a>().</p>


<h3 class="fn"><a name="resizeEvent" />QWorkspace.resizeEvent (<i>self</i>, <a href="qresizeevent.html">QResizeEvent</a>)</h3><p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget.resizeEvent</a>().</p>


<h3 class="fn"><a name="scrollBarsEnabled" />bool QWorkspace.scrollBarsEnabled (<i>self</i>)</h3><h3 class="fn"><a name="setActiveWindow" />QWorkspace.setActiveWindow (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>w</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setActiveWindow(QWidget *)</tt>.</p><p>Makes the child window that contains <i>w</i> the active child
window.</p>
<p><b>See also</b> <a href="qworkspace.html#activeWindow">activeWindow</a>().</p>


<h3 class="fn"><a name="setBackground" />QWorkspace.setBackground (<i>self</i>, <a href="qbrush.html">QBrush</a>&#160;<i>background</i>)</h3><h3 class="fn"><a name="setScrollBarsEnabled" />QWorkspace.setScrollBarsEnabled (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="showEvent" />QWorkspace.showEvent (<i>self</i>, <a href="qshowevent.html">QShowEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#showEvent">QWidget.showEvent</a>().</p>


<h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QWorkspace.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>


<h3 class="fn"><a name="tile" />QWorkspace.tile (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void tile()</tt>.</p><p>Arranges all child windows in a tile pattern.</p>
<p><b>See also</b> <a href="qworkspace.html#cascade">cascade</a>()
and <a href="qworkspace.html#arrangeIcons">arrangeIcons</a>().</p>


<h3 class="fn"><a name="wheelEvent" />QWorkspace.wheelEvent (<i>self</i>, <a href="qwheelevent.html">QWheelEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qwidget.html#wheelEvent">QWidget.wheelEvent</a>().</p>


<h3 class="fn"><a name="windowList" />list-of-QWidget QWorkspace.windowList (<i>self</i>, <a href="qworkspace.html#WindowOrder-enum">WindowOrder</a>&#160;<i>order</i>&#160;=&#160;QWorkspace.CreationOrder)</h3><p>Returns a list of all visible or minimized child windows. If
<i>order</i> is <a href="qworkspace.html#WindowOrder-enum">CreationOrder</a> (the default),
the windows are listed in the order in which they were inserted
into the workspace. If <i>order</i> is <a href="qworkspace.html#WindowOrder-enum">StackingOrder</a>, the windows
are listed in their stacking order, with the topmost window as the
last item in the list.</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="windowActivated" />void windowActivated (QWidget *)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the child window <i>w</i> becomes
active. Note that <i>w</i> can be 0, and that more than one signal
may be emitted for a single activation event.</p>
<p><b>See also</b> <a href="qworkspace.html#activeWindow">activeWindow</a>() and <a href="qworkspace.html#windowList">windowList</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>